#include <system.h>

/* Defines a GDT entry. Use packed because it prevents the compiler
*  from optimizing */
struct gdt_entry
{
	unsigned short limit_low;
	unsigned short base_low;
	unsigned char base_middle;
	unsigned char access;
	unsigned char granularity;
	unsigned char base_high;
} __attribute__((packed));

/* Special pointer which includes the limit: The max bytes taken up
*  by the GDT, minus 1. Again, this needs to be packed */
struct gdt_ptr
{
	unsigned short limit;
	unsigned int base;
} __attribute__((packed));

/* GDT with 3 entries, and special GDT pointer */
struct gdt_entry gdt[3];
struct gdt_ptr gp;

/* function in start.asm. Reloads the new segment registers */
extern void gdt_flush();
